<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="ProjectMgtSystem.Entities.*" %>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<jsp:include page="../../template/user_top.jsp"/>
<!--our main content starts here--->
<table id="travel">
    <thead>
        <tr>
            <th scope="col">Project ID</th>
            <th scope="col">Project Name</th>
            <th scope="col">Team Leader</th>
            <th scope="col">Language</th>
            <th scope="col">Description</th>
        </tr>
    </thead>
    <tfoot>
        <%
                     java.util.ArrayList<Project> projList = (java.util.ArrayList<Project>) request.getAttribute("partiProjList");
                     for (Project proj : projList) {%>
        <html:form action="/AssignmentAction">
            <tr>

                <%

                    out.print("<td>" + proj.getProjectID() + "</td>");
                    out.print("<td>" + proj.getProjectName() + "</td>");
                    out.print("<td>" + proj.getTeamLeader().getEngineerID() + "_" + proj.getTeamLeader().getFirstName() + " " + proj.getTeamLeader().getLastName() + "</td>");
                    out.print("<td>" + proj.getLanguage() + "</td>");
                    out.print("<td>" + proj.getDescription() + "</td>");
                %>
                <%
                    if (request.getAttribute("USERID").toString().equalsIgnoreCase(proj.getTeamLeader().getEngineerID())) {
                %>


                <td><html:submit property="method"><bean:message key="AssignmentAction.viewTaskByProj"/></html:submit>
                    <% }%>
                    <html:hidden property="projectid" value="<%=proj.getProjectID()%>"/>
                    <html:hidden property="userid" value="${requestScope.USERID}"/></td>
                    <%
                        out.print("</tr>");
                    %>

            </html:form>   
            <%     }
            %>
    </tfoot>
</table>
<!--our main content ends here -->

<jsp:include page="../../template/user_bottom.jsp"/>